//-*-Igor-*-
// ###################################################################
// Igor Pro - JEG Image Tools
//
//	FILE: "JEG Strings as Lists"
//									  created: 8/11/1998 {1:27:33 PM} 
//								  last update: 8/11/1998 {2:39:49 PM} 
//	Author:	Jonathan Guyer
//  E-mail: <jguyer@his.com>
//     WWW: <http://www.his.com/~jguyer/>
//	
//	Description: 
//	  Additional string-list routines
// 
//	History
// 
//	modified by	 rev reason
//	-------- --- --- -----------
//	08/11/98 JEG 1.0 original
// ###################################################################

#include <Strings as Lists>
#include <NumInList>

//
// -------------------------------------------------------------------------
//	 
// "JEG_WhichItemInList" --
// 
//  Written by Jim Prouty <jim@wavemetrics.com> of WaveMetrics
//	
//  Returns the list index of item in list 
//  (FindItemInList returns the _string_ index of the item)
// -------------------------------------------------------------------------
//
Function JEG_WhichItemInList(list,item,separator)
	String list, item, separator
	
	Variable items= NumInList(list, separator)
	if( items < 1 )
		return -1
	endif
	String anItem
	do
		anItem= GetStrFromList(list, items, separator)
		if( CmpStr(item,anItem) == 0 )	// case insensitive
			break;
		endif
		items -= 1
	while ( items > 0 )
	return items	// -1 if not found
End


